package com.cn.service.impl;

import com.cn.mapper.UserMapper;
import com.cn.pojo.User;
import com.cn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    /**
     * 添加单个用户
     * @param user
     * @return 1表示成功，0表示失败
     */
    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }
    /**
     * 通过用户名查询用户id
     * @param userName
     * @return
     */
    @Override
    public int queryUserIdByName(String userName) {
        return userMapper.queryUserIdByName(userName);
    }
}
